<template>
    <div class="content">
        
        <el-table class="mt20" :data="tableData" border v-loading="form.loading" style="width: 100%;font-size: 16px;">
            <el-table-column type="index" :index="indexMethod" label="序号" width="60" align="center" />
            <el-table-column prop="name" label="姓名" align="center" />
            <el-table-column prop="attendance_date" label="考勤日期" align="center"  />
            <el-table-column prop="in_time" label="上班打卡时间" align="center" />
            <el-table-column prop="out_time" label="下班打卡时间" align="center" />
            <el-table-column prop="status" label="考勤状态" align="center" />
            <el-table-column prop="working_hours" label="工作时长" align="center" />
            <el-table-column prop="remarks" label="备注" width="80" align="center" />
        </el-table>
    </div>
</template>

<script lang="ts" setup>
import { ref,onMounted } from 'vue'
import http from '../../../util/request';
const indexMethod = (index: number) => {
  return index+= 1
}
const form = ref<any>({search:'',loading:false,parentBorder:false})

const tableData = ref<any>([])

const onGetData = () => {
    
    form.value.loading = true
    http.post('/labourer/attendance',form.value).then((response:any)=>{
        form.value.loading = false
        tableData.value = response.data.data
    })
}

onMounted(()=>{
    onGetData()
})

</script>

<style scoped>

</style>